// Date: 2023/11/21 16:20

package utils

import (
	"fmt"
	"time"
)

// TimeCost 计算函数执行时间
func TimeCost(desc string) func() {
	start := time.Now()
	return func() {
		tc := time.Since(start).Seconds()
		fmt.Printf("%s time cost = %v\n", desc, tc)
	}
}
